﻿@model FCNS.ERP.Models.ErpRoomIO

@{
    ViewBag.Title = "开房-录入";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@ViewBag.Title</h2>
<script src="~/WebExtend/My97DatePicker/WdatePicker.js"></script>  
<script type="text/javascript">
    $(document).ready(function () {
        $("#Price").val(@ViewData["price"]);
        $("#RoomId").val(@ViewData["roomId"]);
        });
</script>

@using (Html.BeginForm()) 
{ 
    <div class="form-horizontal">
        <hr />
        <div class="row">
            <div class="col-sm-1"></div>

            <div class="col-sm-5">
                @Html.ValidationSummary(true, "", new { @class = "text-danger" })
                @Html.HiddenFor(model => model.RoomId)

                <div class="form-group">
                    @Html.LabelFor(model => model.DateTimeStart, htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.EditorFor(model => model.DateTimeStart, new { htmlAttributes = new { @class = "form-control", @onClick = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" } })
                        @Html.ValidationMessageFor(model => model.DateTimeStart, "", new { @class = "text-danger" })
                    </div>
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.CorSId, htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.DropDownList("CorSId", ViewData["CorS"] as SelectList, htmlAttributes: new { @class = "form-control" })
                        @Html.ValidationMessageFor(model => model.CorSId, "", new { @class = "text-danger" })
                    </div>
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.InitPrice, htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.EditorFor(model => model.InitPrice, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.InitPrice, "", new { @class = "text-danger" })
                    </div>
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.Price, htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.EditorFor(model => model.Price, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.Price, "", new { @class = "text-danger" })
                    </div>
                </div>

                <div class="form-group">
                    @Html.LabelFor(model => model.RoomType, htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.EnumDropDownListFor(model => model.RoomType, htmlAttributes: new { @class = "form-control" })
                        @Html.ValidationMessageFor(model => model.RoomType, "", new { @class = "text-danger" })
                    </div>
                </div>


                <div class="form-group">
                    @Html.LabelFor(model => model.Time, htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.EditorFor(model => model.Time, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.Time, "", new { @class = "text-danger" })
                    </div>
                </div>
                </div>

            <div class="col-sm-5"></div>

            <div class="col-sm-1"></div>
            </div>
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <input type="submit" value="新增" class="btn btn-default" />
                    </div>
                </div>
            </div>
}

<div>
    @Html.ActionLink(" 返回", "Kroom",null, new { @class = "backToListImg" })
</div>
